/**
 *   获取文件
 * @author qianl
 * @date 2023/8/7 16:25
 * @return
 * @param path 路径
 * @param init 文件不存在创建文件
 */
export const getFile = (path: string, init: boolean): Promise<string> => {
  return new Promise((resolve) => {
    resolve(window.ipcCom.getFileText(path, init));
  });
};

/**
 *   保存文件
 * @author qianl
 * @date 2023/8/7 16:25
 * @return 保存成功
 * @param path 路径
 * @param data 内容
 */
export const saveFile = (path: string, data: string): Promise<string> => {
  return new Promise((resolve) => {
    resolve(window.ipcCom.saveFileText(path, data));
  });
};
